//
//  HaoBaFirstGuideViewController.m
//  HaoBaShengxinEn
//
//  Created by luoy on 2024/6/19.
//

#import "HaoBaFirstGuideViewController.h"
#import "HaoBaTabbarVC.h"
@interface HaoBaFirstGuideViewController () {
    NSInteger _currentShowIdx;
    NSArray *_allPage;
}

@property (weak, nonatomic) IBOutlet UIImageView *imgPage;

@end

@implementation HaoBaFirstGuideViewController
- (IBAction)bclickNextPageButton:(UIButton *)sender {
    _currentShowIdx += 1;
    if (_currentShowIdx >= 3) {
        [self bSrtRoot];
        
    }else{
        self.imgPage.image = [UIImage imageNamed:_allPage[_currentShowIdx]];
    }
}

- (void)bSrtRoot {
    HaoBaTabbarVC* tabVC=[[HaoBaTabbarVC alloc]init];
    [UIApplication sharedApplication].delegate.window.rootViewController = tabVC;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"firstHaoba"];
    _currentShowIdx = 0;
    CGFloat hei = self.view.bounds.size.height;
    if(hei > 880){
        _allPage = @[@"haoba_c1",@"haoba_c2",@"haoba_c3"];
    } else {
        _allPage = @[@"haoba_c12",@"haoba_c22",@"haoba_c32"];
    }
    
}

@end
